<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h = "http://java.sun.com/jsf/html"
      xmlns:f = "http://java.sun.com/jsf/core">
    <f:view>
        <h:head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Register a customer</title>
        </h:head>
        <h:body>
            <h1>Register a customer</h1>
            <hr/>

            <h:form>
                <h:panelGrid columns="3">
                    <h:outputLabel value="First name:" for="fname" />
                    <h:inputText id="fname" value="#{customerController.customer.fname}" title="First name" required="true" />
                    <h:message for="fname" />
                    <h:outputLabel value="Last name:" for="lname" />
                    <h:inputText id="lname" value="#{customerController.customer.lname}" title="Last name" required="true" />
                    <h:message for="lname" />
                    <h:outputLabel value="E-mail:" for="email" />
                    <h:inputText id="email" value="#{customerController.customer.email}" title="E-mail" validator="emailValidator" />
                    <h:message for="email" />
                    <h:outputLabel value="Password:" for="password" />
                    <h:inputText id="password" value="#{customerController.customer.pass}" title="Password" required="true" />
                    <h:message for="password" />

                    <h:outputLabel value="Street:" for="street" />
                    <h:inputText id="street" value="#{customerController.customer.address.street}" title="Street" required="true" />
                    <h:message for="street" />
                    <h:outputLabel value="City:" for="city" />
                    <h:inputText id="city" value="#{customerController.customer.address.city}" title="City" required="true" />
                    <h:message for="email" />
                    <h:outputLabel value="Country:" for="country" />
                    <h:inputText id="country" value="#{customerController.customer.address.country}" title="Country" required="true" />
                    <h:message for="country" />

                </h:panelGrid>

                <h:commandButton value="Register !" action="#{customerController.doCreateCustomer}" />

            </h:form>



        </h:body>
    </f:view>
</html>


